/* 全局样式重置 */
* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Ant Design 样式覆盖 */
.ant-layout {
  background: transparent !important;
}

.ant-menu {
  border-right: none !important;
}

.ant-menu-item {
  margin: 0 !important;
  border-radius: 0 !important;
}

.ant-menu-submenu {
  margin: 0 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .ant-layout-sider {
    position: fixed !important;
    z-index: 1002 !important;
    height: 100vh !important;
  }

  .ant-layout-header {
    left: 0 !important;
    padding: 0 16px !important;
  }

  .ant-layout-content {
    margin: 16px 8px !important;
    padding: 16px !important;
  }
}

/* 加载动画 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

/* 卡片样式增强 */
.ant-card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ant-card-head {
  border-bottom: 1px solid #f0f0f0;
}

/* 表格样式增强 */
.ant-table {
  border-radius: 8px;
}

.ant-table-thead>tr>th {
  background: #fafafa;
  font-weight: 600;
}

/* 按钮样式增强 */
.ant-btn {
  border-radius: 6px;
  font-weight: 500;
}

/* 表单样式增强 */
.ant-form-item-label>label {
  font-weight: 500;
}

/* 统计卡片样式 */
.stat-card {
  text-align: center;
  padding: 24px;
}

.stat-card .ant-statistic-title {
  margin-bottom: 8px;
  color: #666;
  font-size: 14px;
}

.stat-card .ant-statistic-content {
  font-size: 24px;
  font-weight: bold;
}

/* 趋势指示器 */
.trend-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  margin-top: 8px;
}

.trend-indicator.positive {
  color: #52c41a;
}

.trend-indicator.negative {
  color: #ff4d4f;
}

/* 自定义工具提示 */
.custom-tooltip {
  max-width: 300px;
}

/* KOI-ADMIN 风格增强 */
.dashboard-stat-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* 统计卡片动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-stat-card {
  animation: fadeInUp 0.6s ease-out;
}

.dashboard-stat-card:nth-child(1) {
  animation-delay: 0.1s;
}

.dashboard-stat-card:nth-child(2) {
  animation-delay: 0.2s;
}

.dashboard-stat-card:nth-child(3) {
  animation-delay: 0.3s;
}

.dashboard-stat-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* 图表容器样式 */
.chart-container {
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.dark .chart-container {
  background: #141414;
}

/* 暗色主题滚动条 */
.dark ::-webkit-scrollbar-track {
  background: #2f2f2f;
}

.dark ::-webkit-scrollbar-thumb {
  background: #555;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-success {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-bg-warning {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-bg-error {
  background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
}

/* 增强卡片悬浮效果 */
.ant-card {
  transition: all 0.3s ease;
  border-radius: 12px !important;
}

.ant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* 按钮悬浮效果 */
.ant-btn {
  transition: all 0.3s ease;
}

.ant-btn:hover {
  transform: translateY(-1px);
}

/* 字体优化 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}